<template>
  <div>
    {{ count }}
  </div>
  <button @click="countChange">点击++</button>
</template>

<script setup>
import { ref, watch } from "vue";
const state = ref({ count: 0 });
const countChange = () => {
  state.value.count++;
};
// watch 深度监听
watch(
  state,
  () => {
    console.log("state变化了");
  },
  {
    deep: true,
  }
);
</script>

<style scoped></style>
